import request from '../utils/request';

export function getProducts(id) {
    if (id) {
        return request({
            url: `/api/products/${id}`,
            method: 'get'
        });
    } else {
        return request({
            url: '/api/products',
            method: 'get'
        });
    }
};

export async function getBrand() {
    return request({
        url: '/api/brand',
        method: 'get'
    })
}
export async function getProductsByBrandID(brandId) {
    return request({
        url: `/api/getProductsByBrandID/${brandId}`,
        method: 'get'
    })
}